﻿using System;
using API.Interfaces;
using Framework.Business;
using Framework.Extensions;
using RealDataReceiver.Business;
using RealDataReceiver.Entities;

namespace RealDataReceiver.Service
{
    public class AlarmQueryService : RestServiceBase<AlarmQueryRequest>
    {
        public override object OnPost(AlarmQueryRequest request)
        {
            var response = new AlarmQueryResponse();

            try
            {
                var ctx = new ServiceContextBase<AlarmQueryRequest, AlarmQueryResponse>(request, response);

                AlarmReceiveBusiness.RetrieveRealData(ctx);
            }
            catch (Exception e)
            {
                response.CaptureException(e);
            }
            return response;
        }
    }
}
